from functional import seq

name = ['lizikun', 'duanzhenkun', '123']


# 映射处理函数
def replace(x):
    if x == 'lizikun':
        return "LIZIKUN"
    return x


# way1 map中传入一个lambda匿名函数
result = seq(name).map(lambda x: replace(x)).to_list()
print(result)

print('******************************************')

# way2 map中传入函数引用
result = seq(name).map(replace).to_list()
print(result)

result = seq(name).filter(lambda x: x.isdigit()).to_list()
print(result)
